﻿/*  
	------------------------------------------------------------------------
	 NQ Core Library
	
	 Homepage: http://www.awzhome.de/
	------------------------------------------------------------------------
	
	This Source Code Form is subject to the terms of the Mozilla Public
	License, v. 2.0. If a copy of the MPL was not distributed with this
	file, You can obtain one at http://mozilla.org/MPL/2.0/.
   
	The Original Code is code of NQ Core Library.

	The Initial Developer of the Original Code is Andreas Weizel.
	Portions created by the Initial Developer are
	Copyright (C) 2012 Andreas Weizel. All Rights Reserved.
	
	Contributor(s): (none)
	
	------------------------------------------------------------------------
*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AWZhome.NQ.Core
{
	/// <summary>
	/// Interface for component loader implementations, that define, how
	/// the metadata for the component-based architecture is obtained.
	/// </summary>
	public interface INQComponentLoader
	{
		/// <summary>
		/// Loads all components and their metadata.
		/// </summary>
		/// <returns>
		/// Enumeration of <see cref="AWZhome.NQ.Core.INQComponentInfo">INQComponentInfo</see> instances
		/// that describe the loaded components.
		/// </returns>
		IEnumerable<INQComponentInfo> LoadComponentData();

		/// <summary>
		/// Loads all service metadata.
		/// </summary>
		/// <returns>
		/// Enumeration of <see cref="AWZhome.NQ.Core.INQServiceInfo">INQServiceInfo</see> instances
		/// that describe the loaded components.
		/// </returns>
		IEnumerable<INQServiceInfo> LoadServiceData();

		/// <summary>
		/// Loads a component with all appropriate assemblies.
		/// </summary>
		/// <param name="componentInfo">
		/// An <see cref="AWZhome.NQ.Core.INQComponentInfo">INQComponentInfo</see> instance describing the component to load.
		/// </param>
		/// <returns><c>True</c>, if the component has been loaded successfully, <c>false</c> otherwise.</returns>
		bool LoadComponentAssemblies(INQComponentInfo componentInfo);

		/// <summary>
		/// Returns the path where component assemblies can be found. The value returned here
		/// can be retrieved using <see cref="AWZhome.NQ.Core.INQServiceManager.ComponentPath">INQServiceManager.ComponentPath</see>.
		/// </summary>
		/// <returns>The path where component assemblies can be found.</returns>
		string GetComponentPath();
	}
}
